using System;
using System.Collections.Generic;
using System.Text;
using PSSymbolStore;

namespace PSSymbolStore.Manager
{
    class TransactionSortableBindingList<T> : SortableBindingList<T> where T : Transaction
    {
        public T FindByTransactionId(string transactionId)
        {
            if (String.IsNullOrEmpty(transactionId))
            {
                return null;
            }

            foreach (Transaction transaction in this.Items)
            {
                if (transaction.TransactionId.Equals(transactionId, StringComparison.InvariantCultureIgnoreCase))
                {
                    return (T)transaction;
                }
            }

            return null;
        }
    }
}
